<!--conf
<sample>
              <product version="1.5" edition="pro"/>
                     <modifications>
                            <modified date="070101"/>
                     </modifications>
               </sample>
 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Start and End of loading </title>
</head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
<body>
	<h1>XML loading events</h1>
	
<p>Loading events occur when XML parsing starts and finishes. To test this functionality open/close nodes or refresh the tree (hardly detectable on fast connection)</p>
	<table>
		<tr>
			<td valign="top">
				<div id="treeboxbox_tree" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;"></div>
			</td>
			<td rowspan="2" style="padding-left:25" valign="top">
				
				<input type="checkbox" id="a_1" checked> <label for="a_1">Show alerts for event</label><br>
				<div style="display:none" id="b_1"><h1 style="color:red">Loading</h1></div>
				<div style="display:none" id="b_2"><h1 style="color:green">Done</h1></div>				
			</td>
		</tr>
		
	</table>
	<br>

	<script>
			tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);

			tree.setSkin('dhx_skyblue');
			tree.setImagePath("../../../codebase/imgs/dhxtree_skyblue/");
			tree.enableSmartXMLParsing(true);
			tree.setOnLoadingStart(func_a);
			tree.setOnLoadingEnd(func_b);			
			tree.loadXML("../common/tree.xml");
			function func_a(){
				document.getElementById("b_1").style.display="";
				document.getElementById("b_2").style.display="none";				
				if (document.getElementById("a_1").checked) alert("Loading start");
			}
			function func_b(){
				document.getElementById("b_2").style.display="";
				document.getElementById("b_1").style.display="none";				
				if (document.getElementById("a_1").checked) alert("Loading end");				
			}
			
								
	</script>


</body>
</html>
